<template>
  <div class="member-home">
    <!-- 信息 -->
    <home-overview />
    <!-- 收藏 -->
    <HomePanel title="我的收藏">
      <GoodsItem v-for="item in goods" :key="item.id" :goods="item" />
    </HomePanel>
    <!-- 足迹 -->
    <HomePanel title="我的足迹">
      <GoodsItem v-for="item in goodsFoot" :key="item.id" :goods="item" />
    </HomePanel>
    <!-- 猜你 -->
    <GoodsRelevant />
  </div>
</template>
<script setup>
import HomeOverview from './components/home-overview.vue'
import HomePanel from './components/home-panel.vue'
import GoodsRelevant from '@/views/goods/components/goods-relevant.vue'
import GoodsItem from '@/views/category/components/goods-item.vue'
import { findCollect, getFootPrint } from '@/api/member'
import { ref } from '@vue/reactivity'

const goods = ref(null)
findCollect({ pageSize: 4 }).then(({ result }) => {
  goods.value = result.items
})

const goodsFoot = ref(null)
getFootPrint({ pageSize: 4 }).then(({ result }) => {
  goodsFoot.value = result.items
})
</script>
<style scoped lang="less">
:deep(.xtx-carousel) .carousel-btn.prev {
  left: 2px;
}
:deep(.xtx-carousel) .carousel-btn.next {
  right: 2px;
}
</style>
